1. Field of the Invention
The invention relates to a network system, and more particularly, to a packet forwarding device and method thereof.
2. Description of the Prior Art
As computer network's progress, network packet forwarding devices (such as switch, router, gateway) have become necessary devices. Please refer to FIG. 1, which is a diagram of a conventional switch 100. As shown in FIG. 1, the switch 100 comprises a processor 110 (e.g. a normal CPU) coupled to an external network device 140; a forwarding unit 120; and a plurality of physical interfaces 130. Generally speaking, the forwarding unit 120 is implemented by an ASIC and is coupled to the processor 110 through a bus. The conventional switch 100 is utilized to forward a packet from the external network device 140 to a plurality of physical interfaces 130, or to forward a packet from one of the physical interfaces 130 to the external network device 140.
The processor 110 utilizes the bus to communicate with the forwarding unit 120 and to transfer the packet to the forwarding unit 120. Therefore, if the processor 110 and the forwarding unit 120 have to cooperate to forward a packet, a novel communication protocol between the processor 110 and the forwarding unit 120 should be developed. Obviously, this increases the circuit complexity of the conventional switch 100 and also increases the rates of mistake occurrence of the entire system. This is especially true for some specific works (for example, IGMP snooping or adding a PPTP/L2TP header into the packet when the packet has to be forwarded to the wireless network interface), as the forwarding unit 120 cannot independently complete such works. Instead, the forwarding unit 120 has to cooperate with the processor 110 to complete the specific works. Therefore, a method and related device is needed to allow the processor 110 and the forwarding unit 120 to deal with the packet forwarding works together.